﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace mbine.msgc.model
{
    public class CServerMessage
    {
        public string Message { get; set; }
        public string AuthKey { get; set; }
        public string Data { get; set; }

        public CServerMessage()
        {
        }

        public bool LoginCheck(string _s)
        {
            Dictionary<string, object> dict = JsonConvert.DeserializeObject<Dictionary<string, object>>(_s);

            Message = dict["msg"].ToString();
            AuthKey = dict["authkey"].ToString();
            Data = (dict["roster"] != null) ? dict["roster"].ToString() : null;
            return (dict["result"].ToString() == "0") ? false : true;
        }
    }
}
